import {createRouter, createWebHistory} from "vue-router";

import LoginPage from "@/views/LoginPage.vue";
import studentIndexPage from "@/views/student/index.vue"
import ScoresOverviewPage from "@/views/teacher/ScoresOverview.vue";
import ScoresManagementPage from "@/views/teacher/ScoresManagement.vue";
import MyCoursesPage from "@/views/teacher/MyCourses.vue";
import TeacherProfilePage from "@/views/teacher/Profile.vue";
import studentHomePage from "@/views/student/HomePage.vue"
import studentSourcePage from "@/views/student/FindSorce.vue"
import studentProfilePage from "@/views/student/Profile.vue"
const routes = [
    {
        path: '/',
        redirect: '/login',

    },{
        path: '/login',
        name: 'login',
        component: () => {
            return import('@/views/LoginPage.vue')
        },
    },{
        path: '/student',
        name: 'student-index',
        component: studentIndexPage,
    }
    ,{
        path: '/student',
        name: 'student-index',
        component: studentIndexPage,
        redirect: '/student/index',
        children: [
            {
                path: 'index',
                name: 'StudentHome',
                component: studentHomePage,
            }, {
                path: 'profile',
                name: 'StudentProfile',
                component: studentProfilePage,
            }, {
                path: 'scores',
                name: 'StudentScores',
                component: studentSourcePage
            }
        ]
    }
    ,{
        path: '/teacher',
        name: 'teacher-index',
        component:  () => import('@/views/teacher/index.vue'),
        redirect: '/teacher/index',
        children: [
            {
                path: 'index',
                component: () => import('@/views/teacher/HomePage.vue'),
            },
            {
                path: 'scores-overview',
                component: () => import('@/views/teacher/ScoresOverview.vue'),
            },{
                path: 'scores-management',
                component: () => import('@/views/teacher/ScoresManagement.vue'),
            },{
                path: 'my-classes',
                component: () => import('@/views/teacher/MyCourses.vue'),
            },{
                path: 'profile',
                component: () => import('@/views/teacher/Profile.vue'),
            }
        ]
    },
    {
        path: '/admin',
        name: 'admin',
        redirect: "/admin-home",
        component: () => import('@/views/AdminPage.vue'),
        children: [
            {
                path: '/admin-home',
                name: 'admin-home',
                component: () => import('@/views/AdminHomePage.vue'),
            },
            {
                path: '/manage-student',
                name: 'manage-student',
                component: () => import('@/views/managers/ManageStudentPage.vue'),
            },
            {
                path: '/manage-teacher',
                name: 'manage-teacher',
                component: () => import('@/views/managers/ManageTeacherPage.vue'),
            },
            {
                path: '/manage-major',
                name: 'manage-major',
                component: () => import('@/views/managers/ManageMajorPage.vue'),
            },
            {
                path: '/manage-course',
                name: 'manage-course',
                component: () => import('@/views/managers/ManageCoursePage.vue'),
            },
            {
                path: '/manage-college',
                name: 'manage-college',
                component: () => import('@/views/managers/ManageCollegePage.vue'),
            },
            {
                path: '/manage-class',
                name: 'manage-class',
                component: () => import('@/views/managers/ManageClassPage.vue'),
            },
            {
                path:'/manage-lecture',
                name:'manage-lecture',
                component: () => import('@/views/managers/ManageLecturePage.vue'),
            },
            {
                path: '/score-review',
                name: 'score-review',
                component: () => import('@/views/managers/ScoreReviewPage.vue'),
            }
        ]
    },
]
const router = createRouter({ history: createWebHistory(), routes })
export default router
